from rest_framework import serializers
from goods.models import SKU


class SKUSerializer(serializers.ModelSerializer):
    count = serializers.IntegerField(read_only=True)

    class Meta:
        model = SKU
        fields = '__all__'


# 订单页显示商品信息序列化器
class OrdersShowGoodsSerializer(serializers.Serializer):
    freight = serializers.DecimalField(max_digits=10, decimal_places=2)
    skus = SKUSerializer(many=True)




